package mp3;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * Everything but title, album and year can be updated from database
 * @author Mallampati
 *
 */
public class ManageMP3DB {
	
	private String folderToManagePath;
	
	public ManageMP3DB(String folderToManagePath) {
		this.folderToManagePath = folderToManagePath;
	}
	
	public void syncWithDB() throws Exception {
		File folder = new File(folderToManagePath);
		ModifyFolder mf = new ModifyFolder();
		List<String> allMp3 = new ArrayList<String>();
		mf.listFilesForFolder(folder, allMp3);
		for(String mp3Path : allMp3) {
			File testFile = new File(mp3Path);
			ModifyMP3 m = new ModifyMP3(testFile, true);
			m.start();
		}
		//NOTE: don't zip edited becuase some songs could have been deleted
	}

}
